#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main() {
    char arr[3][3] = { 0 };
    int i = 0, j = 0;
    char k = 'o';
    for (i = 0; i < 3; i++)
    {
        for (j = 0; j < 3; j++)
        {
            scanf(" %c", &arr[i][j]);
        }
    }
    for (i = 0; i < 3; i++)
    {
        if (arr[i][0] == arr[i][1] && arr[i][2] == arr[i][1] && arr[i][0] == arr[i][2] && arr[i][2] != 'O')
        {
            k = arr[i][0];
            break;
        }
        if (arr[0][i] == arr[1][i] && arr[0][i] == arr[2][i] && arr[2][i] == arr[1][i] && arr[1][i] != 'o')
        {
            k = arr[0][i];
            break;
        }
    }
    if (arr[0][0] == arr[1][1] && arr[1][1] == arr[2][2] && arr[0][0] == arr[2][2] && arr[0][0] != 'o')
        k = arr[0][0];
    if (arr[0][2] == arr[1][1] && arr[1][1] == arr[2][0] && arr[2][0] == arr[0][2] && arr[0][2] != 'o')
        k = arr[0][2];
    if (k == 'K')
        printf("KiKi wins!\n");
    else if (k == 'B')
        printf("BoBo wins!\n");
    else
        printf("No winner!\n");
    return 0;
}